package com.andeveloper.springdemo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.alibaba.dubbo.config.annotation.Reference;
import com.andeveloper.springdemo.service.HelloService;

@Controller
@RequestMapping("/hello")
public class HelloController {
	
	@Reference
	private HelloService helloService;
	
	@RequestMapping("/sayHello")
	public String sayHello(Model model) {
		String sayHello = helloService.sayHello("dubbo");
		model.addAttribute("sayHello", sayHello);
		return "hello";
	}
}
